package com.witte.controller;
import com.witte.entity.*;
import com.witte.service.OfferService;
import com.witte.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.ParameterResolutionDelegate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Random;

@Controller
@ResponseBody
@RequestMapping("/api/Sales")
@CrossOrigin
public class OfferController {
    @Autowired
    OfferService offerService ;
    @GetMapping(value="/offer/getAllList")
    public RespBean getAllList(Integer beginPage,Integer pageSize){
        // System.out.println("111");
        List<Offer> list=offerService.selectForPage(beginPage,pageSize);
        RespBean respBean=RespBean.error("新加错误！");
        if(list!=null) {
            respBean=RespBean.ok("ok",list);
            respBean.setTotleSize(offerService.getCount());
        }
        return respBean;
    }
}
